package com.yeban.bams.mapper;

import com.yeban.bams.entity.Account;
import com.yeban.bams.vo.BaseAccountDTO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface BaseAccountMapper {

    // 只查询账号基础字段（如 id, type），不查询 loanAmount、ceiling 等字段
    @Select("select acc_number as id, type from account where acc_number = #{id}")
    BaseAccountDTO  selectBaseById(Long id);

    @Select("select acc_number as id, type from account where acc_number = #{id} and password = #{pwd}")
    BaseAccountDTO selectBaseByIdAndPwd(@Param("id") Long id, @Param("pwd") String pwd);

    // 查询所有基础账户信息
    @Select("select acc_number as id, type from account")
    java.util.List<BaseAccountDTO> selectAllBase();
}
